package com.itchen.servlet;


import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.Arrays;
import java.util.Map;

/**
 * @author げっしょく
 * @date 2021/8/29
 */

@WebServlet("/test3")
public class TestServlet3 extends HttpServlet {
    @Override
    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //Map<String, String[]> getParameterMap():获取所有参数Map集合
        Map<String, String[]> pa = req.getParameterMap();
        for (String s : pa.keySet()) {
            System.out.println(s + Arrays.toString(pa.get(s)));
        }

        //String[ ] getParameterValues(String name) :根据名称获取参数值(数组)
        //String getParameter(String name):根据名称获取参数值(单个值)
    }

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {

    }
}
